/***********************************************
 This file is part of redia-bapps-main-ios.
 
 Copyright (c) 2015 Redia A/S
 
 Redia-bapps-main-ios is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 Redia-bapps-main-ios is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with redia-bapps-main-ios.  If not, see <http://www.gnu.org/licenses/>.
 
 *********************************************** */

//
//  BACPRPolicyViewController.m
//  redia-bapps-ios
//
//  Created by Mads Darø Kristensen on 10/1/13.
//  Copyright (c) 2013 redia. All rights reserved.
//

#import "BACPRPolicyPopup.h"
#import "BAUtils.h"
#import "BALibrarySettings.h"
#import "BARootViewController.h"
#import "BAPatronSettings.h"

@interface BACPRPolicyPopup () {
    UIAlertView* theAlert;
}

@end

@implementation BACPRPolicyPopup

-(void)showPopup
{
    theAlert = [[UIAlertView alloc] initWithTitle:@""
                                          message:@"Ved at gå videre accepterer du, at Biblioteket gemmer information om dine søgninger for at forbedre dine søgeresultater. Oplysningerne hemmeligholdes, og videregives ikke til tredjepart."
                                         delegate:self
                                cancelButtonTitle:@"Afbryd"
                                otherButtonTitles:@"Accepter", nil];
    [theAlert show];

}

-(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
    if (buttonIndex==1) {
        if (self.delegate) {
            [self.delegate userAnsweredCPRPolicy:YES];
        }
    } else {
        if (self.delegate) {
            [self.delegate userAnsweredCPRPolicy:NO];
        }

    }
}


/* old code
- (IBAction)acceptButtonPressed:(id)sender
{
    [self dismissViewControllerAnimated:YES completion:^{
        if (self.delegate) {
            [self.delegate userAnsweredCPRPolicy:YES];
        }
    }];
}

- (IBAction)rejectButtonPressed:(id)sender
{
    [self dismissViewControllerAnimated:YES completion:^{
        if (self.delegate) {
            [self.delegate userAnsweredCPRPolicy:NO];
        }
    }];
}
*/


@end
